import {Component, OnInit} from '@angular/core';
import {Router} from '@angular/router';

@Component({
  selector: 'app-home',
  templateUrl: './home.component.html',
  styleUrls: ['./home.component.css']
})
export class HomeComponent implements OnInit {

  constructor(private router: Router) {
  }

  content =
    'To be, or not to be, that is a question: Whether it is nobler in the mind to suffer. The slings and arrows of ' +
    'outrageous fortune Or to take arms against a sea of troubles, And by opposing end them? To die: to sleep; ' +
    'No more; and by a sleep to say we end The heart-ache and the thousand natural shocks That flesh is heir to, ' +
    '\'tis a consummation Devoutly to be wish\'d. To die, to sleep To sleep- perchance to dream: ay, there\'s the rub! ' +
    'For in that sleep of death what dreams may come When we have shuffled off this mortal coil, Must give us pause. ' +
    'There \'s the respect That makes calamity of so long life';
  offlineContent = '年轻时总是对自己的认识不够，有时候觉得自己能力卓越，有时候觉得自己聪明伶俐，长大后，经历的事情多了，才发现自己是一无是处，平凡无能。\n' +
    '\n' +
    '鱼和熊掌不可兼得，但单身和穷可以。\n' +
    '\n' +
    '这个世界是很公平的，当你得到了某些东西，势必也会失去某些东西。比如富人得到了金钱，却失去了烦恼。\n' +
    '\n' +
    '有时候我们需要的不是一碗鸡汤，而是一个巴掌！有些人出现在你的生命里，就是为了告诉你：你真好骗。';
  rows = 1;

  tooltips = ['terrible', 'bad', 'normal', 'good', 'wonderful'];
  movies = [{
    name: '霸王别姬',
    score: 4,
    year: '1999',
    duration: 104,
    imgUrl: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1593945833710&di=db031406ea73ddf7ddde320b0af4e9b3&imgtype=0&src=http%3A%2F%2Fh.hiphotos.baidu.com%2Fbaike%2Fs%253D220%2Fsign%3D78e10834bc99a9013f355c342d940a58%2F0d338744ebf81a4c36de38e9d32a6059252da626.jpg'
  }, {
    name: '星球大战4',
    score: 3,
    year: '1999',
    duration: 104,
    imgUrl: 'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3998601295,1968860007&fm=26&gp=0.jpg'
  }, {
    name: '怦然心动',
    score: 2,
    year: '1999',
    duration: 104,
    imgUrl: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1593946626853&di=573dd39876b8b14a6525ecfff03fa7cb&imgtype=0&src=http%3A%2F%2Fimg2.imgtn.bdimg.com%2Fit%2Fu%3D2058677752%2C90517481%26fm%3D214%26gp%3D0.jpg'
  }, {
    name: '这个杀手不太冷',
    score: 4,
    year: '1999',
    duration: 104,
    imgUrl: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1593946707096&di=1ee6bd820451d57ad6b7c8a3edcb52ff&imgtype=0&src=http%3A%2F%2Fimage2.xyzs.com%2Fupload%2F73%2F27%2F113%2F20150506%2F143090192485340_0.jpg'
  }, {
    name: 'V字仇杀队',
    score: 2,
    year: '1999',
    duration: 104,
    imgUrl: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1593946733236&di=db4cc025fb0b8ae4c12d803e14a1f04a&imgtype=0&src=http%3A%2F%2Fi0.hdslb.com%2Fbfs%2Farchive%2Ffca780bcf11265d3d53319d144fca81b8d7f708d.jpg'
  }, {
    name: 'test',
    score: 1,
    year: '2000',
    duration: 95,
    imgUrl: 'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3023589786,894738962&fm=11&gp=0.jpg'
  }];
  offlineMovies = [{
    name: '教父2',
    score: 4,
    year: '1974',
    duration: 104,
    imgUrl: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1594219204028&di=c343400fdf36f1a252557f251231160d&imgtype=0&src=http%3A%2F%2F5b0988e595225.cdn.sohucs.com%2Fimages%2F20171130%2F367752b7e4ce4ca69b5762020772a6c1.jpeg'
  }, {
    name: '狮子王',
    score: 3,
    year: '1999',
    duration: 104,
    imgUrl: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1594219188638&di=20939f00ddf5cca2eb27afbb28c5f6f9&imgtype=0&src=http%3A%2F%2Fcdn.lizhi.fm%2Faudio_cover%2F2016%2F06%2F17%2F29308910798871431.jpg'
  }, {
    name: '指环王2：双塔奇兵',
    score: 2,
    year: '1999',
    duration: 104,
    imgUrl: 'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3006940722,2784155938&fm=26&gp=0.jpg'
  }, {
    name: '大闹天宫',
    score: 4,
    year: '1999',
    duration: 104,
    imgUrl: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1594219144382&di=410c0e96b5df0aac905de994201d12f3&imgtype=0&src=http%3A%2F%2Fc.hiphotos.baidu.com%2Fbaike%2Fpic%2Fitem%2F4d086e061d950a7b9889fdf40bd162d9f2d3c946.jpg'
  }, {
    name: '窃听风暴',
    score: 2,
    year: '1999',
    duration: 104,
    imgUrl: 'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=883917014,2164795966&fm=26&gp=0.jpg'
  }, {
    name: '猫鼠游戏',
    score: 1,
    year: '2000',
    duration: 95,
    imgUrl: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=1813593174,200881203&fm=26&gp=0.jpg'
  }];

  ngOnInit(): void {
  }

  public switchToExplore(content: string): void {
    this.router.navigate(['/explore'], { queryParams: { search: content } });
  }

}
